﻿<%@ Page Language="C#" MasterPageFile="~/U_masterP.master" AutoEventWireup="true"
    CodeFile="gigdetails.aspx.cs" Inherits="gigdetails" %>

<%@ Register Src="uc_main/sideBar_right.ascx" TagName="sideBar_right" TagPrefix="uc1" %>
<%@ Register Assembly="CollectionPager" Namespace="SiteUtils" TagPrefix="cc1" %>
<%@ Register Src="CaptchaCtrl.ascx" TagName="CaptchaCtrl" TagPrefix="uc2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <asp:Literal ID="LiterTitle" runat="server"></asp:Literal>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <script src="/js/mediaplayer510/jwplayer.js" type="text/javascript"></script>
    <div id="content_top">
        <div id="kep2">
            <table>
                <tr>
                    <td>
                        <a>
                            <img id="avar_s" runat="server" /></a>
                    </td>
                    <td valign="middle">
                        <span class="ten">
                            <asp:Label ID="lblNguoidang" runat="server" Text="Label"></asp:Label>
                        </span>
                        <br />
                        <img id="quocgia_s" runat="server" />
                    </td>
                </tr>
            </table>
        </div>
        <div id="tags2">
            <p>
                <asp:Label ID="lbltags" runat="server"></asp:Label></p>
        </div>
        <div id="lienhenguoiban">
            <p>
                <div class="bao_dh">
                    <asp:Repeater ID="Repeater1" runat="server">
                        <ItemTemplate>
                            <a class="btn" <% if(Session["KhachHang"]==null) { %> href="<%=URLHelper.BuildURL("Dang-nhap") %>" <% } else { %>
                                href='<%# Eval("idGig","/datHang.aspx?id={0}") %>' <% } %>><span class="btn_nd">Đặt hàng
                                    (5$)</span> <span class="btn_nd2">Đặt hàng (5$)</span> </a></div> </p>
                            <% if (Session["KhachHang"] == null || Session["KhachHang"] == "") { }
                               else
                               { %><p>
                                   <a href='/conversation.aspx?user=<%# Eval("UsernameE") %>&idgig_lq=<%# Eval("idGig") %>'
                                       id='<%# Eval("UsernameE") %>' onclick="return chekcA()" class="lh">Liên hệ với người
                                       bán</a>
                               </p>
                            <% } %>
                        </ItemTemplate>
                    </asp:Repeater>
                </div>
        </div>
        <div class="clear">
        </div>
        
        <div id="content_left2">
            <!-- Bat dau Chi Tiet -->
            <div id="chitiet_dv">
                <div id="dv_td">
                    <table cellpadding="0px" cellspacing="0px">
                        <tr class="dvtd_tren">
                            <td>
                                <asp:Label ID="lblNgay" runat="server"></asp:Label>
                                ngày
                            </td>
                            <td>
                                100%
                            </td>
                            <td>
                                <asp:Label ID="lblDonHang" runat="server"></asp:Label>
                            </td>
                        </tr>
                        <tr class="dvtd_duoi">
                            <td>
                                Giao Hàng
                            </td>
                            <td>
                                Đánh Giá
                            </td>
                            <td>
                                Đặt Hàng
                            </td>
                        </tr>
                    </table>
                </div>
                <div id="dv_noidung">
                    <div id="noidung_con">
                        <table width="100%" style="overflow: hidden;">
                            <tr>
                                <td>
                                    <div id="tamhinh" runat="server">
                                    </div>
                                    <!-- load video vao div nay -->
                                    <div id='myplayer'>
                                    </div>
                                    <!-- load video vao div nay -->
                                    <asp:Literal ID="Literal1" runat="server"></asp:Literal>
                                    <%# Eval("NgayBL","{0:dd-MM-yyyy}") %>
                                </td>
                                <td valign="top" style="padding-left: 5px">
                                    <p>
                                        <asp:Label ID="lblGioithieu" runat="server" Text="Label"></asp:Label></p>
                                </td>
                            </tr>
                            <tr>
                                <td class="share" style="text-align: center; height: 70px; z-index: 99999px; vertical-align: top"
                                    colspan="2">
                                    <%# Eval("NgayBL","{0:dd-MM-yyyy}") %>
                                    <!-- AddThis Button BEGIN -->
                                    <%--<div class="fb-like" data-send="true" data-width="450" data-show-faces="true" data-font="tahoma"></div>--%>
                                    <!-- Place this tag where you want the +1 button to render. -->
                                    <%--  <div class="g-plusone"></div>--%>
                                    <!-- AddThis Button BEGIN -->
                                    <div class="mxh">
                                    <span class='st_facebook_large' displayText='Facebook'></span>
                                        <span class='st_twitter_large' displayText='Tweet'></span>
                                        <span class='st_linkedin_large' displayText='LinkedIn'></span>
                                        <span class='st_pinterest_large' displayText='Pinterest'></span>
                                        <span class='st_googleplus_large' displayText='Google +'></span>
                                        <span class='st_email_large' displayText='Email'></span>
                                        <span class='st_sharethis_large' displayText='ShareThis'></span>
                                    </div>
                                    <%--<div style="float: left; width: 80px">
                                        <!-- Place this tag where you want the +1 button to render. -->
                                        <div class="g-plusone" data-size="medium">
                                        </div>
                                    </div>--%>
                                   <%-- <div class="addthis_toolbox addthis_default_style" style="float: left; width: 85%">
                                        <a class="addthis_button_facebook_like" id="like-button" style="width: 100px"></a>
                                        <a class="addthis_button_tweet" style="width: 94px"></a>
                                        <a class="addthis_button_linkedin_counter" style="width: 100px; padding-right: 5px"></a>
                                        <a class="addthis_button_pinterest_pinit" style="width: 60px"></a>
                                        <a href="http://www.addthis.com/bookmark.php" style="text-decoration: none;color: #0098F8;margin-right:80px;font-size:16px;font-weight:bold" class="addthis_button">More</a>
                                    </div>
                                    <script type="text/javascript">
                                        e = document.getElementByID('like-button');
                                        e.createAttribute('fb:like:send', 'true');
                                    </script>--%>
                                    <!-- AddThis Button END -->
                                </td>
                                <td>
                                  <%--  <img id="antang" runat="server" style="display:none"/>--%>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div class="clear">
                    </div>
                    <div id="tagss">
                        <div id="tag_trai">
                            <img src="<%=ResolveClientUrl("~/img/tag_icon.jpg") %>"/></div>
                        <div id="tag_phai">
                            <asp:Label ID="lblTagss" runat="server"></asp:Label></div>
                    </div>
                </div>
            </div>
            <!-- Ket thuc Chi Tiet -->
            <div id="binhluan">
                <div id="bl_head">
                    <ul style="padding-top: 3px;">
                        <li>
                            <div id="songuoilike">
                                <asp:Label ID="lblSLNLike" runat="server"></asp:Label>
                            </div>
                            <div id="like">
                                <img src='<%=ResolveClientUrl("img/good_big.png") %>'/>
                            </div>
                            <div class="clear">
                            </div>
                        </li>
                        <li>
                            <div id="songuoilike">
                            <asp:Label ID="lblSLNDisL" runat="server"></asp:Label>    
                            </div>
                            <div id="like">
                                <img src='<%=ResolveClientUrl("img/bad_big.png")%>' />
                                </div>
                            <div class="clear">
                            </div>
                        </li>
                    </ul>
                </div>
                <div class="clear">
                </div>
                <div id="bl_content">
                    <div id="bl_bao">
                        <div id="bian" style="font-size: 12px; padding: 10px 10px;" runat="server">
                            Không có bình luận nào về công việc này.</div>
                        <table>
                            <tr>
                                <td colspan="2" style="min-height: 100px">
                                    <div id="nocm" runat="server">
                                    </div>
                                    <asp:DataList ID="DataList1" runat="server" Width="100%">
                                        <ItemTemplate>
                                            <!-- bat dau 1 comment -->
                                            <tr>
                                                <td rowspan="2">
                                                    <a>
                                                        <img src="<%=ResolveClientUrl("~/img/ava2.jpg") %>" /></a>
                                                </td>
                                                <td>
                                                    <span class="nikname"><a>
                                                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("UsernameE") %>'></asp:Label></a></span>
                                                    đã viết vào <span class="ngaycomment">(<%# Eval("NgayBL","{0:dd-MM-yyyy}") %>)</span>
                                                </td>
                                            </tr>
                                            <tr style="margin-bottom: 10px">
                                                <td>
                                                    <span class='comments tycm<%# Eval("Type") %>'>
                                                        <%# Eval("NoiDungBL") %></span>
                                                </td>
                                            </tr>
                                            <!-- bat dau 1 comment -->
                                        </ItemTemplate>
                                    </asp:DataList>
                                    <br />
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <cc1:CollectionPager ID="CollectionPager1" runat="server" LabelText="Trang thứ : &amp;nbsp;"
                                        SliderSize="5" BackText="&amp;nbsp;« Trang trước" LabelStyle="FONT-WEIGHT: bold;margin-left:10px;color:#898989;"
                                        ResultsLocation="None" ResultsStyle="" NextText="Trang kế »" BackNextButtonStyle="color:#045f9e;"
                                        BackNextDisplay="HyperLinks" BackNextStyle="color:#045f9e;" ControlStyle="color:#ff7200;"
                                        PageNumbersStyle="color:#045f9e;" PageNumberStyle="color:#64a2e9;" QueryStringKey="p">
                                    </cc1:CollectionPager>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <%--<% if (Session["KhachHang"] != null)
                       { %>
                    <!-- Form Binh luan -->
                    <asp:UpdatePanel ID="upPanel" runat="server" UpdateMode="Conditional">
                        <ContentTemplate>
                            <div id="bl_wrap">
                                <div id="hinhykien">
                                    <a href="#" id="ykien">
                                        <img src="img/ykiencuaban.gif" /></a></div>
                                <div id="bl_form">
                                    <div class="f_bao">
                                        <div class="f_trai">
                                            <asp:TextBox CssClass="bl1" ID="txtTieuDeCM" runat="server" Width="100%" Text="Họ tên"></asp:TextBox></div>
                                        <div class="f_phai">
                                            <asp:TextBox CssClass="bl2" ID="txtEmailCMa" runat="server" Width="100%" Text="Email"></asp:TextBox></div>
                                    </div>
                                    <div class="f_bao">
                                        <div class="f_trai">
                                            <asp:TextBox CssClass="bl3" ID="txtHoTenCM" runat="server" Width="100%" Text="Tiêu đề"></asp:TextBox></div>
                                        <div class="f_phai">
                                            <asp:Label ID="lblNgayComment" CssClass="ngaythang" runat="server"></asp:Label>
                                        </div>
                                    </div>
                                    <div class="f_bao">
                                        <div class="f_noidung">
                                            <asp:TextBox ID="txtNDCM" CssClass="bl4" runat="server" Width="99%" TextMode="MultiLine"
                                                Rows="10"></asp:TextBox></div>
                                    </div>
                                    <div class="f_bao">
                                        <uc2:CaptchaCtrl ID="CaptchaCtrl1" runat="server" />
                                    </div>
                                    <div class="f_bao" style="padding-top: 5px; padding-bottom: 10px">
                                        <asp:Button ID="btnBL" runat="server" CssClass="button_V" Text="Gửi bình luận" OnClientClick="return OnSubmitComment()"
                                            Width="101px" OnClick="btnBL_Click1" />&nbsp;
                                        <input id="Button2" type="button" value="Xóa hết" class="button_V" onclick="XoaMau()" />
                                    </div>
                                </div>
                            </div>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                    <% }
                       else if (Session["KhachHang"] == null)
                       { %>
                    <div style="font-size: 11px; width: 100%; margin: 0px auto; border-left: 1px solid #c9c7c7;
                        border-right: 1px solid #c9c7c7; padding-left: 3px; background: #e6e5e5">
                        Hãy <a class="link_comau" href="signin.aspx">đăng nhập </a>để có thể bình luận về
                        công việc này.</div>
                    <% }
                       else if (Session["BinhLuan"] != null)
                       { %>
                    <div style="font-size: 11px; width: 100%; margin: 0px auto; border-left: 1px solid #c9c7c7;
                        border-right: 1px solid #c9c7c7; padding-left: 3px; background: #e6e5e5">
                        Bạn đã gửi bình luận cho công việc này rồi. Vui lòng bình luận lại sau</div>
                    <%}
                       else { } %>--%>
                    <!-- End Form -->
                    <asp:Literal ID="liComment" runat="server"></asp:Literal>
                    <div id="bv_lienquan">
                        <table>
                            <tr class="tieude">
                                <td colspan="2" valign="middle">
                                    <img src="<%=ResolveClientUrl("~/img/article.png") %>" hspace="0" vspace="0" height="21px" /><span style="vertical-align: top;">
                                        Các bài viết được đăng bởi
                                        <asp:Label CssClass="tennglq" ID="lblNguoiPostLQ" runat="server"></asp:Label></span>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div id="bian2" style="font-size: 12px; padding: 10px 10px;" runat="server">
                                        Không có bài viết nào liên quan</div>
                                </td>
                            </tr>
                            <asp:Repeater ID="rptLienQuan" runat="server">
                                <ItemTemplate>
                                    <!-- bat dau lap -->
                                    <tr>
                                        <td>
                                            <a>
                                                <img id="avatarlq" src="../img/arrow.png" width="20px" height="20px" /></a>
                                        </td>
                                        <td valign="middle">
                                            <span class="tieude_lq"><a href='<%#URLHelper.BuildURLCATE(Eval("TenCate_E").ToString(),Eval("TenCongViec_KD")+"-"+Eval("idGig").ToString())%>'>
                                                Tôi sẽ
                                                <asp:Label ID="Label2" runat="server" Text='<%# Eval("TenCongViec") %>'></asp:Label>
                                                chỉ với 5$.</a></span>
                                        </td>
                                    </tr>
                                    <!-- ket thuc lap -->
                                </ItemTemplate>
                            </asp:Repeater>
                        </table>
                    </div>
                </div>
            </div>
        </div>
        <div id="content_right" style="margin: 5px 50px 5px 0px">
            <uc1:sideBar_right ID="sideBar_right1" runat="server" />
        </div>
        <style>
            .tennglq
            {
                vertical-align: top;
                color: #666;
            }
            .tycm0
            {
            	background:url(/img/good1.png) no-repeat 0 50%;
            	padding-left:25px;
            }
            .tycm1
            {
            	background:url(/img/bad1.png) no-repeat 0 50%;
            	padding-left:25px;
            }
        </style>
        <script type="text/javascript">
            window.___gcfg = { lang: 'vi' };

            (function () {
                var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
                po.src = 'https://apis.google.com/js/plusone.js';
                var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
            })();

            (function (d, s, id) {
                var js, fjs = d.getElementsByTagName(s)[0];
                if (d.getElementById(id)) return;
                js = d.createElement(s); js.id = id;
                js.src = "//connect.facebook.net/vi_VN/all.js#xfbml=1";
                fjs.parentNode.insertBefore(js, fjs);
            } (document, 'script', 'facebook-jssdk'));
    
        </script>
        <script type="text/javascript">
            var text1 = "Họ tên";
            var text2 = "Email";
            var text3 = "Tiêu đề";
            var text4 = "Nội dung";
            $(function () {
                // $("#bl_form").hide();
                $("#ykien").click(function () {
                    $("#bl_form").toggle()
                    return false;
                });
            });
            $(function () {
                //1-----------------------------------
                $(".bl1").focus(function () {
                    txt_truoc = $(this).val();
                    if ($(this).val() == text1)
                        $(this).val("");
                    //$(this).css("border","1px #8bc33d solid");
                });

                $(".bl1").blur(function () {
                    if ($(this).val() == "")
                        $(this).val(text1);
                    //$(this).css("border","1px #d9dada solid");
                });

                //2-----------------------------------
                $(".bl2").focus(function () {
                    txt_truoc = $(this).val();
                    if ($(this).val() == text2)
                        $(this).val("");
                    //$(this).css("border","1px #8bc33d solid");
                });

                $(".bl2").blur(function () {
                    if ($(this).val() == "")
                        $(this).val(text2);
                    //$(this).css("border","1px #d9dada solid");
                });

                //3-----------------------------------
                $(".bl3").focus(function () {
                    txt_truoc = $(this).val();
                    if ($(this).val() == text3)
                        $(this).val("");
                    // $(this).css("border","1px #8bc33d solid");
                });

                $(".bl3").blur(function () {
                    if ($(this).val() == "")
                        $(this).val(text3);
                    //$(this).css("border","1px #d9dada solid");
                });

                //4-----------------------------------
                $(".bl4").focus(function () {
                    txt_truoc = $(this).val();
                    if ($(this).val() == text4)
                        $(this).val("");
                    //$(this).css("border","1px #8bc33d solid");
                });

                $(".bl4").blur(function () {
                    if ($(this).val() == "")
                        $(this).val(text4);
                    //$(this).css("border","1px #d9dada solid");
                });
            });

            //ham xoa het
            function XoaMau() {
                $(".bl1").val(text1);
                $(".bl2").val(text2);
                $(".bl3").val(text3);
                $(".bl4").val(text4);
            }
            // Ktra
            function chekcA() {
                var userPP = '<%=UsNa %>';
                var userCC = $('.lh').attr("id");
                if (userPP == userCC) {
                    alert("Không thể tạo liên hệ với mình !");
                    return false;
                }
            }
            // ham ktra Rong + email
            function OnSubmitComment() {
                if ($(".bl1").val() == "" || $(".bl1").val() == text1) {
                    alert("Mời bạn nhập họ tên!");
                    $(".bl1").focus();
                    return false;
                }
                else if ($(".bl2").val() == "" || $(".bl2").val() == text2) {
                    alert("Mời bạn nhập email!");
                    $(".bl2").focus();
                    return false;
                }
                else if ($(".bl3").val() == "" || $(".bl3").val() == text3) {
                    alert("Mời bạn nhập Tiêu đề!");
                    $(".bl3").focus();
                    return false;
                }
                else if ($(".bl4").val() == "" || $(".bl4").val() == text4) {
                    alert("Mời bạn nhập Nội dung!");
                    $(".bl4").focus();
                    return false;
                }
                else {
                    var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
                    var emailaddressVal = $(".bl2").val();
                    if (!emailReg.test(emailaddressVal)) {
                        alert("Email không hợp lệ! Mời bạn nhập lại email!");
                        $(".bl2").focus();
                        return false;
                    }
                }

                return true;
            }
        </script>
        <div id="fb-root">
        </div>
        <script>
            window.fbAsyncInit = function () {
                FB.init({
                    appId: '424436074264640', // App ID
                    channelUrl: '//WWW.vieclamgap.net/channel.html', // Channel File
                    status: true, // check login status
                    cookie: true, // enable cookies to allow the server to access the session
                    xfbml: true  // parse XFBML
                });

                // Additional initialization code here
            };

            // Load the SDK Asynchronously
            (function (d) {
                var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
                if (d.getElementById(id)) { return; }
                js = d.createElement('script'); js.id = id; js.async = true;
                js.src = "//connect.facebook.net/en_US/all.js";
                ref.parentNode.insertBefore(js, ref);
            } (document));
        </script>
</asp:Content>
